package com.lungle.warmdiary.app.model.response;

import com.lungle.warmdiary.app.AppException;
import com.lungle.warmdiary.app.model.Entity;
import com.lungle.warmdiary.app.model.ListEntity;

import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by God on 2016/8/16.
 */
public class CommentList extends Entity implements ListEntity {

    private List<Comment> data = new ArrayList<>();
    private int total;

    public static CommentList parse(InputStream inputStream) throws IOException,
            AppException {
        CommentList commentList = new CommentList();
        for (int i = 0; i < 10; i++) {
            Comment comment = Comment.parse(null);
            commentList.data.add(comment);
        }

        return commentList;

    }

    public List<Comment> getData() {
        return data;
    }

    public void setData(List<Comment> data) {
        this.data = data;
    }

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    @Override

    public List<Comment> getList() {
        return data;
    }
}
